package inst.logic.beans;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;


import inst.ejb.utilities.BaseSessionBean;
import inst.logic.entities.AccInfo;
import inst.logic.interfaces.AccInfoDao;


@Stateless
@Local(AccInfoDao.class)
@Remote(AccInfoDao.class)
public class AccInfoImpl extends BaseSessionBean<AccInfo> implements AccInfoDao {

	@Override
	public AccInfo findAccInfoByCid(String cid) {
		StringBuffer sqlBuffer=new StringBuffer();
	    List<AccInfo> list=new ArrayList<AccInfo>();
		Map<String, Object> params=new HashMap<String, Object>();
		sqlBuffer.append(" from AccInfo where intAccNo like :intAccNo");
		params.put("intAccNo", "%"+cid+"%");
		list= findListByEJBQL(sqlBuffer.toString(), params);
		if(null != list && list.size()>0){
			return list.get(0);
		}
		 else {
			return null;
		}
	}

}
